home *** CD-ROM | disk | FTP | other *** search
- { This program demonstrates how to call the routines in the joysubs.o module. }
- PROGRAM joytest;
-
- VAR c: char;
-
- { These 3 routines are in the joysubs file-- we need to declare them EXTERNAL
- here: }
- { Call this before calling Stick() to turn off the mouse }
- PROCEDURE Init_Stick;
- EXTERNAL;
- { Call this to turn the mouse back on }
- PROCEDURE End_Stick;
- EXTERNAL;
- { Call this routine to get the current joystick value. The values returned
- for the eight directions are as follows:
- 5 1 9
- \|/ If the trigger is depressed, the 128 will be added to the
- 4-0-8 direction value
- /|\
- 6 2 10
- "which_stick" should be given the value 0 or 1. }
- FUNCTION Stick( which_stick: integer ): integer;
- EXTERNAL;
-
- BEGIN
- Init_Stick;
- REPEAT
- writeln( Stick(0):2:h, ' ', Stick(1):2:h );
- UNTIL keypress;
- read(c);
- End_Stick;
- END.
-